Resilience¶

$$ Resilience = \frac{Readiness*(1-Vulnerability)}{Readiness + (1- Vulnerability)}$$

Correlation between our two KPI¶

In [49]:
Ready_Vulnerability

No clear linear relation between the Readiness and the Vulnerability of a city.

Map of the cities split into three categories according to their Readiness¶

In [58]:
m
Out[58]:
Make this Notebook Trusted to load map: File -> Trust Notebook

Red : Poorly Prepared to withstand a shock Orange : Midly Prepared to withstand a shock Green : Fully Prepared to withstand a shock

Too many questions and features in our initial survey that lead to too many missing answers¶

A need to decrease the number of questions for our survey to be more user-friendly and quicker to fill¶

We therefore implemented a feature selection¶

In [62]:
Targets.show()
In [68]:
plt.barh([x for x in range(len(importance))], importance, tick_label = X.columns)
plt.title('Features importance for Vulnerability');
In [71]:
plt.barh([x for x in range(len(importance))], importance, tick_label = X.columns)
plt.title('Features importance for Readiness');

SVM model for features selection according to our Targets¶

SVM model for Readiness¶

In [144]:
plt.figure()
plt.xlabel("Number of features selected")
plt.ylabel("Cross validation score (nb of correct classifications)")
plt.plot(range(min_features_to_select, len(rfecv1.grid_scores_) + min_features_to_select),rfecv1.grid_scores_)
plt.show()

SVM model for Vulnerability¶

In [149]:
plt.figure()
plt.xlabel("Number of features selected")
plt.ylabel("Cross validation score (nb of correct classifications)")
plt.plot(range(min_features_to_select,len(rfecv.grid_scores_) + min_features_to_select),rfecv.grid_scores_)
plt.show()

Pipeline and ML models¶

We selected 10 features from our analysis to train our Machine Learning model on¶

Nearest Neighbors model¶